<?php


/**
 * Base class that represents a query for the 'bonus_goals_forms' table.
 *
 *
 *
 * @method EmpevalBonusGoalsFormsQuery orderById($order = Criteria::ASC) Order by the id column
 * @method EmpevalBonusGoalsFormsQuery orderByUserPositionId($order = Criteria::ASC) Order by the user_position_id column
 * @method EmpevalBonusGoalsFormsQuery orderByEditorId($order = Criteria::ASC) Order by the editor_id column
 * @method EmpevalBonusGoalsFormsQuery orderByBonusPeriodId($order = Criteria::ASC) Order by the bonus_period_id column
 * @method EmpevalBonusGoalsFormsQuery orderByYear($order = Criteria::ASC) Order by the year column
 * @method EmpevalBonusGoalsFormsQuery orderByType($order = Criteria::ASC) Order by the type column
 * @method EmpevalBonusGoalsFormsQuery orderByStatus($order = Criteria::ASC) Order by the status column
 * @method EmpevalBonusGoalsFormsQuery orderByTmpStatus($order = Criteria::ASC) Order by the tmp_status column
 * @method EmpevalBonusGoalsFormsQuery orderByComment($order = Criteria::ASC) Order by the comment column
 * @method EmpevalBonusGoalsFormsQuery orderByNoAcceptReason($order = Criteria::ASC) Order by the no_accept_reason column
 * @method EmpevalBonusGoalsFormsQuery orderByActive($order = Criteria::ASC) Order by the active column
 * @method EmpevalBonusGoalsFormsQuery orderByDeletedDate($order = Criteria::ASC) Order by the deleted_date column
 * @method EmpevalBonusGoalsFormsQuery orderByLastModified($order = Criteria::ASC) Order by the last_modified column
 * @method EmpevalBonusGoalsFormsQuery orderByCreated($order = Criteria::ASC) Order by the created column
 *
 * @method EmpevalBonusGoalsFormsQuery groupById() Group by the id column
 * @method EmpevalBonusGoalsFormsQuery groupByUserPositionId() Group by the user_position_id column
 * @method EmpevalBonusGoalsFormsQuery groupByEditorId() Group by the editor_id column
 * @method EmpevalBonusGoalsFormsQuery groupByBonusPeriodId() Group by the bonus_period_id column
 * @method EmpevalBonusGoalsFormsQuery groupByYear() Group by the year column
 * @method EmpevalBonusGoalsFormsQuery groupByType() Group by the type column
 * @method EmpevalBonusGoalsFormsQuery groupByStatus() Group by the status column
 * @method EmpevalBonusGoalsFormsQuery groupByTmpStatus() Group by the tmp_status column
 * @method EmpevalBonusGoalsFormsQuery groupByComment() Group by the comment column
 * @method EmpevalBonusGoalsFormsQuery groupByNoAcceptReason() Group by the no_accept_reason column
 * @method EmpevalBonusGoalsFormsQuery groupByActive() Group by the active column
 * @method EmpevalBonusGoalsFormsQuery groupByDeletedDate() Group by the deleted_date column
 * @method EmpevalBonusGoalsFormsQuery groupByLastModified() Group by the last_modified column
 * @method EmpevalBonusGoalsFormsQuery groupByCreated() Group by the created column
 *
 * @method EmpevalBonusGoalsFormsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method EmpevalBonusGoalsFormsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method EmpevalBonusGoalsFormsQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method EmpevalBonusGoalsFormsQuery leftJoinBonusPeriods($relationAlias = null) Adds a LEFT JOIN clause to the query using the BonusPeriods relation
 * @method EmpevalBonusGoalsFormsQuery rightJoinBonusPeriods($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BonusPeriods relation
 * @method EmpevalBonusGoalsFormsQuery innerJoinBonusPeriods($relationAlias = null) Adds a INNER JOIN clause to the query using the BonusPeriods relation
 *
 * @method EmpevalBonusGoalsFormsQuery leftJoinUsers($relationAlias = null) Adds a LEFT JOIN clause to the query using the Users relation
 * @method EmpevalBonusGoalsFormsQuery rightJoinUsers($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Users relation
 * @method EmpevalBonusGoalsFormsQuery innerJoinUsers($relationAlias = null) Adds a INNER JOIN clause to the query using the Users relation
 *
 * @method EmpevalBonusGoalsFormsQuery leftJoinUserPositions($relationAlias = null) Adds a LEFT JOIN clause to the query using the UserPositions relation
 * @method EmpevalBonusGoalsFormsQuery rightJoinUserPositions($relationAlias = null) Adds a RIGHT JOIN clause to the query using the UserPositions relation
 * @method EmpevalBonusGoalsFormsQuery innerJoinUserPositions($relationAlias = null) Adds a INNER JOIN clause to the query using the UserPositions relation
 *
 * @method EmpevalBonusGoalsFormsQuery leftJoinRejections($relationAlias = null) Adds a LEFT JOIN clause to the query using the Rejections relation
 * @method EmpevalBonusGoalsFormsQuery rightJoinRejections($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Rejections relation
 * @method EmpevalBonusGoalsFormsQuery innerJoinRejections($relationAlias = null) Adds a INNER JOIN clause to the query using the Rejections relation
 *
 * @method EmpevalBonusGoalsFormsQuery leftJoinMboGoals($relationAlias = null) Adds a LEFT JOIN clause to the query using the MboGoals relation
 * @method EmpevalBonusGoalsFormsQuery rightJoinMboGoals($relationAlias = null) Adds a RIGHT JOIN clause to the query using the MboGoals relation
 * @method EmpevalBonusGoalsFormsQuery innerJoinMboGoals($relationAlias = null) Adds a INNER JOIN clause to the query using the MboGoals relation
 *
 * @method EmpevalBonusGoalsFormsQuery leftJoinSummary($relationAlias = null) Adds a LEFT JOIN clause to the query using the Summary relation
 * @method EmpevalBonusGoalsFormsQuery rightJoinSummary($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Summary relation
 * @method EmpevalBonusGoalsFormsQuery innerJoinSummary($relationAlias = null) Adds a INNER JOIN clause to the query using the Summary relation
 *
 * @method EmpevalBonusGoalsFormsQuery leftJoinEmployeeEvaluations($relationAlias = null) Adds a LEFT JOIN clause to the query using the EmployeeEvaluations relation
 * @method EmpevalBonusGoalsFormsQuery rightJoinEmployeeEvaluations($relationAlias = null) Adds a RIGHT JOIN clause to the query using the EmployeeEvaluations relation
 * @method EmpevalBonusGoalsFormsQuery innerJoinEmployeeEvaluations($relationAlias = null) Adds a INNER JOIN clause to the query using the EmployeeEvaluations relation
 *
 * @method EmpevalBonusGoalsFormsQuery leftJoinTaskGoals($relationAlias = null) Adds a LEFT JOIN clause to the query using the TaskGoals relation
 * @method EmpevalBonusGoalsFormsQuery rightJoinTaskGoals($relationAlias = null) Adds a RIGHT JOIN clause to the query using the TaskGoals relation
 * @method EmpevalBonusGoalsFormsQuery innerJoinTaskGoals($relationAlias = null) Adds a INNER JOIN clause to the query using the TaskGoals relation
 *
 * @method EmpevalBonusGoalsFormsQuery leftJoinKpi($relationAlias = null) Adds a LEFT JOIN clause to the query using the Kpi relation
 * @method EmpevalBonusGoalsFormsQuery rightJoinKpi($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Kpi relation
 * @method EmpevalBonusGoalsFormsQuery innerJoinKpi($relationAlias = null) Adds a INNER JOIN clause to the query using the Kpi relation
 *
 * @method EmpevalBonusGoalsFormsQuery leftJoinAcceptance($relationAlias = null) Adds a LEFT JOIN clause to the query using the Acceptance relation
 * @method EmpevalBonusGoalsFormsQuery rightJoinAcceptance($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Acceptance relation
 * @method EmpevalBonusGoalsFormsQuery innerJoinAcceptance($relationAlias = null) Adds a INNER JOIN clause to the query using the Acceptance relation
 *
 * @method EmpevalBonusGoalsForms findOne(PropelPDO $con = null) Return the first EmpevalBonusGoalsForms matching the query
 * @method EmpevalBonusGoalsForms findOneOrCreate(PropelPDO $con = null) Return the first EmpevalBonusGoalsForms matching the query, or a new EmpevalBonusGoalsForms object populated from the query conditions when no match is found
 *
 * @method EmpevalBonusGoalsForms findOneById(int $id) Return the first EmpevalBonusGoalsForms filtered by the id column
 * @method EmpevalBonusGoalsForms findOneByUserPositionId(int $user_position_id) Return the first EmpevalBonusGoalsForms filtered by the user_position_id column
 * @method EmpevalBonusGoalsForms findOneByEditorId(int $editor_id) Return the first EmpevalBonusGoalsForms filtered by the editor_id column
 * @method EmpevalBonusGoalsForms findOneByBonusPeriodId(int $bonus_period_id) Return the first EmpevalBonusGoalsForms filtered by the bonus_period_id column
 * @method EmpevalBonusGoalsForms findOneByYear(int $year) Return the first EmpevalBonusGoalsForms filtered by the year column
 * @method EmpevalBonusGoalsForms findOneByType(int $type) Return the first EmpevalBonusGoalsForms filtered by the type column
 * @method EmpevalBonusGoalsForms findOneByStatus(int $status) Return the first EmpevalBonusGoalsForms filtered by the status column
 * @method EmpevalBonusGoalsForms findOneByTmpStatus(int $tmp_status) Return the first EmpevalBonusGoalsForms filtered by the tmp_status column
 * @method EmpevalBonusGoalsForms findOneByComment(string $comment) Return the first EmpevalBonusGoalsForms filtered by the comment column
 * @method EmpevalBonusGoalsForms findOneByNoAcceptReason(string $no_accept_reason) Return the first EmpevalBonusGoalsForms filtered by the no_accept_reason column
 * @method EmpevalBonusGoalsForms findOneByActive(boolean $active) Return the first EmpevalBonusGoalsForms filtered by the active column
 * @method EmpevalBonusGoalsForms findOneByDeletedDate(string $deleted_date) Return the first EmpevalBonusGoalsForms filtered by the deleted_date column
 * @method EmpevalBonusGoalsForms findOneByLastModified(string $last_modified) Return the first EmpevalBonusGoalsForms filtered by the last_modified column
 * @method EmpevalBonusGoalsForms findOneByCreated(string $created) Return the first EmpevalBonusGoalsForms filtered by the created column
 *
 * @method array findById(int $id) Return EmpevalBonusGoalsForms objects filtered by the id column
 * @method array findByUserPositionId(int $user_position_id) Return EmpevalBonusGoalsForms objects filtered by the user_position_id column
 * @method array findByEditorId(int $editor_id) Return EmpevalBonusGoalsForms objects filtered by the editor_id column
 * @method array findByBonusPeriodId(int $bonus_period_id) Return EmpevalBonusGoalsForms objects filtered by the bonus_period_id column
 * @method array findByYear(int $year) Return EmpevalBonusGoalsForms objects filtered by the year column
 * @method array findByType(int $type) Return EmpevalBonusGoalsForms objects filtered by the type column
 * @method array findByStatus(int $status) Return EmpevalBonusGoalsForms objects filtered by the status column
 * @method array findByTmpStatus(int $tmp_status) Return EmpevalBonusGoalsForms objects filtered by the tmp_status column
 * @method array findByComment(string $comment) Return EmpevalBonusGoalsForms objects filtered by the comment column
 * @method array findByNoAcceptReason(string $no_accept_reason) Return EmpevalBonusGoalsForms objects filtered by the no_accept_reason column
 * @method array findByActive(boolean $active) Return EmpevalBonusGoalsForms objects filtered by the active column
 * @method array findByDeletedDate(string $deleted_date) Return EmpevalBonusGoalsForms objects filtered by the deleted_date column
 * @method array findByLastModified(string $last_modified) Return EmpevalBonusGoalsForms objects filtered by the last_modified column
 * @method array findByCreated(string $created) Return EmpevalBonusGoalsForms objects filtered by the created column
 *
 * @package    propel.generator.empeval.om
 */
abstract class EmpevalBaseBonusGoalsFormsQuery extends ModelCriteria
{
    /**
     * Initializes internal state of EmpevalBaseBonusGoalsFormsQuery object.
     *
     * @param     string $dbName The dabase name
     * @param     string $modelName The phpName of a model, e.g. 'Book'
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
     */
    public function __construct($dbName = 'vgp_empeval', $modelName = 'EmpevalBonusGoalsForms', $modelAlias = null)
    {
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    /**
     * Returns a new EmpevalBonusGoalsFormsQuery object.
     *
     * @param     string $modelAlias The alias of a model in the query
     * @param     EmpevalBonusGoalsFormsQuery|Criteria $criteria Optional Criteria to build the query from
     *
     * @return EmpevalBonusGoalsFormsQuery
     */
    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof EmpevalBonusGoalsFormsQuery) {
            return $criteria;
        }
        $query = new EmpevalBonusGoalsFormsQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }

    /**
     * Find object by primary key.
     * Propel uses the instance pool to skip the database if the object exists.
     * Go fast if the query is untouched.
     *
     * <code>
     * $obj  = $c->findPk(12, $con);
     * </code>
     *
     * @param mixed $key Primary key to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return   EmpevalBonusGoalsForms|EmpevalBonusGoalsForms[]|mixed the result, formatted by the current formatter
     */
    public function findPk($key, $con = null)
    {
        if ($key === null) {
            return null;
        }
        if ((null !== ($obj = EmpevalBonusGoalsFormsPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
            // the object is alredy in the instance pool
            return $obj;
        }
        if ($con === null) {
            $con = Propel::getConnection(EmpevalBonusGoalsFormsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
         || $this->map || $this->having || $this->joins) {
            return $this->findPkComplex($key, $con);
        } else {
            return $this->findPkSimple($key, $con);
        }
    }

    /**
     * Find object by primary key using raw SQL to go fast.
     * Bypass doSelect() and the object formatter by using generated code.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return   EmpevalBonusGoalsForms A model object, or null if the key is not found
     * @throws   PropelException
     */
    protected function findPkSimple($key, $con)
    {
        $sql = 'SELECT ID, USER_POSITION_ID, EDITOR_ID, BONUS_PERIOD_ID, YEAR, TYPE, STATUS, TMP_STATUS, COMMENT, NO_ACCEPT_REASON, ACTIVE, DELETED_DATE, LAST_MODIFIED, CREATED FROM bonus_goals_forms WHERE ID = :p0';
        try {
            $stmt = $con->prepare($sql);
            $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
        }
        $obj = null;
        if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
            $obj = new EmpevalBonusGoalsForms();
            $obj->hydrate($row);
            EmpevalBonusGoalsFormsPeer::addInstanceToPool($obj, (string) $key);
        }
        $stmt->closeCursor();

        return $obj;
    }

    /**
     * Find object by primary key.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return EmpevalBonusGoalsForms|EmpevalBonusGoalsForms[]|mixed the result, formatted by the current formatter
     */
    protected function findPkComplex($key, $con)
    {
        // As the query uses a PK condition, no limit(1) is necessary.
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKey($key)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
    }

    /**
     * Find objects by primary key
     * <code>
     * $objs = $c->findPks(array(12, 56, 832), $con);
     * </code>
     * @param     array $keys Primary keys to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return PropelObjectCollection|EmpevalBonusGoalsForms[]|mixed the list of results, formatted by the current formatter
     */
    public function findPks($keys, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKeys($keys)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->format($stmt);
    }

    /**
     * Filter the query by primary key
     *
     * @param     mixed $key Primary key to use for the query
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByPrimaryKey($key)
    {

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::ID, $key, Criteria::EQUAL);
    }

    /**
     * Filter the query by a list of primary keys
     *
     * @param     array $keys The list of primary key to use for the query
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByPrimaryKeys($keys)
    {

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::ID, $keys, Criteria::IN);
    }

    /**
     * Filter the query on the id column
     *
     * Example usage:
     * <code>
     * $query->filterById(1234); // WHERE id = 1234
     * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
     * $query->filterById(array('min' => 12)); // WHERE id > 12
     * </code>
     *
     * @param     mixed $id The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterById($id = null, $comparison = null)
    {
        if (is_array($id) && null === $comparison) {
            $comparison = Criteria::IN;
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::ID, $id, $comparison);
    }

    /**
     * Filter the query on the user_position_id column
     *
     * Example usage:
     * <code>
     * $query->filterByUserPositionId(1234); // WHERE user_position_id = 1234
     * $query->filterByUserPositionId(array(12, 34)); // WHERE user_position_id IN (12, 34)
     * $query->filterByUserPositionId(array('min' => 12)); // WHERE user_position_id > 12
     * </code>
     *
     * @see       filterByUserPositions()
     *
     * @param     mixed $userPositionId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByUserPositionId($userPositionId = null, $comparison = null)
    {
        if (is_array($userPositionId)) {
            $useMinMax = false;
            if (isset($userPositionId['min'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::USER_POSITION_ID, $userPositionId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($userPositionId['max'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::USER_POSITION_ID, $userPositionId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::USER_POSITION_ID, $userPositionId, $comparison);
    }

    /**
     * Filter the query on the editor_id column
     *
     * Example usage:
     * <code>
     * $query->filterByEditorId(1234); // WHERE editor_id = 1234
     * $query->filterByEditorId(array(12, 34)); // WHERE editor_id IN (12, 34)
     * $query->filterByEditorId(array('min' => 12)); // WHERE editor_id > 12
     * </code>
     *
     * @see       filterByUsers()
     *
     * @param     mixed $editorId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByEditorId($editorId = null, $comparison = null)
    {
        if (is_array($editorId)) {
            $useMinMax = false;
            if (isset($editorId['min'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::EDITOR_ID, $editorId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($editorId['max'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::EDITOR_ID, $editorId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::EDITOR_ID, $editorId, $comparison);
    }

    /**
     * Filter the query on the bonus_period_id column
     *
     * Example usage:
     * <code>
     * $query->filterByBonusPeriodId(1234); // WHERE bonus_period_id = 1234
     * $query->filterByBonusPeriodId(array(12, 34)); // WHERE bonus_period_id IN (12, 34)
     * $query->filterByBonusPeriodId(array('min' => 12)); // WHERE bonus_period_id > 12
     * </code>
     *
     * @see       filterByBonusPeriods()
     *
     * @param     mixed $bonusPeriodId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByBonusPeriodId($bonusPeriodId = null, $comparison = null)
    {
        if (is_array($bonusPeriodId)) {
            $useMinMax = false;
            if (isset($bonusPeriodId['min'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::BONUS_PERIOD_ID, $bonusPeriodId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($bonusPeriodId['max'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::BONUS_PERIOD_ID, $bonusPeriodId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::BONUS_PERIOD_ID, $bonusPeriodId, $comparison);
    }

    /**
     * Filter the query on the year column
     *
     * Example usage:
     * <code>
     * $query->filterByYear(1234); // WHERE year = 1234
     * $query->filterByYear(array(12, 34)); // WHERE year IN (12, 34)
     * $query->filterByYear(array('min' => 12)); // WHERE year > 12
     * </code>
     *
     * @param     mixed $year The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByYear($year = null, $comparison = null)
    {
        if (is_array($year)) {
            $useMinMax = false;
            if (isset($year['min'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::YEAR, $year['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($year['max'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::YEAR, $year['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::YEAR, $year, $comparison);
    }

    /**
     * Filter the query on the type column
     *
     * Example usage:
     * <code>
     * $query->filterByType(1234); // WHERE type = 1234
     * $query->filterByType(array(12, 34)); // WHERE type IN (12, 34)
     * $query->filterByType(array('min' => 12)); // WHERE type > 12
     * </code>
     *
     * @param     mixed $type The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByType($type = null, $comparison = null)
    {
        if (is_array($type)) {
            $useMinMax = false;
            if (isset($type['min'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::TYPE, $type['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($type['max'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::TYPE, $type['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::TYPE, $type, $comparison);
    }

    /**
     * Filter the query on the status column
     *
     * Example usage:
     * <code>
     * $query->filterByStatus(1234); // WHERE status = 1234
     * $query->filterByStatus(array(12, 34)); // WHERE status IN (12, 34)
     * $query->filterByStatus(array('min' => 12)); // WHERE status > 12
     * </code>
     *
     * @param     mixed $status The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByStatus($status = null, $comparison = null)
    {
        if (is_array($status)) {
            $useMinMax = false;
            if (isset($status['min'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::STATUS, $status['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($status['max'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::STATUS, $status['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::STATUS, $status, $comparison);
    }

    /**
     * Filter the query on the tmp_status column
     *
     * Example usage:
     * <code>
     * $query->filterByTmpStatus(1234); // WHERE tmp_status = 1234
     * $query->filterByTmpStatus(array(12, 34)); // WHERE tmp_status IN (12, 34)
     * $query->filterByTmpStatus(array('min' => 12)); // WHERE tmp_status > 12
     * </code>
     *
     * @param     mixed $tmpStatus The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByTmpStatus($tmpStatus = null, $comparison = null)
    {
        if (is_array($tmpStatus)) {
            $useMinMax = false;
            if (isset($tmpStatus['min'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::TMP_STATUS, $tmpStatus['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($tmpStatus['max'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::TMP_STATUS, $tmpStatus['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::TMP_STATUS, $tmpStatus, $comparison);
    }

    /**
     * Filter the query on the comment column
     *
     * Example usage:
     * <code>
     * $query->filterByComment('fooValue');   // WHERE comment = 'fooValue'
     * $query->filterByComment('%fooValue%'); // WHERE comment LIKE '%fooValue%'
     * </code>
     *
     * @param     string $comment The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByComment($comment = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($comment)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $comment)) {
                $comment = str_replace('*', '%', $comment);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::COMMENT, $comment, $comparison);
    }

    /**
     * Filter the query on the no_accept_reason column
     *
     * Example usage:
     * <code>
     * $query->filterByNoAcceptReason('fooValue');   // WHERE no_accept_reason = 'fooValue'
     * $query->filterByNoAcceptReason('%fooValue%'); // WHERE no_accept_reason LIKE '%fooValue%'
     * </code>
     *
     * @param     string $noAcceptReason The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByNoAcceptReason($noAcceptReason = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($noAcceptReason)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $noAcceptReason)) {
                $noAcceptReason = str_replace('*', '%', $noAcceptReason);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::NO_ACCEPT_REASON, $noAcceptReason, $comparison);
    }

    /**
     * Filter the query on the active column
     *
     * Example usage:
     * <code>
     * $query->filterByActive(true); // WHERE active = true
     * $query->filterByActive('yes'); // WHERE active = true
     * </code>
     *
     * @param     boolean|string $active The value to use as filter.
     *              Non-boolean arguments are converted using the following rules:
     *                * 1, '1', 'true',  'on',  and 'yes' are converted to boolean true
     *                * 0, '0', 'false', 'off', and 'no'  are converted to boolean false
     *              Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByActive($active = null, $comparison = null)
    {
        if (is_string($active)) {
            $active = in_array(strtolower($active), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::ACTIVE, $active, $comparison);
    }

    /**
     * Filter the query on the deleted_date column
     *
     * Example usage:
     * <code>
     * $query->filterByDeletedDate('2011-03-14'); // WHERE deleted_date = '2011-03-14'
     * $query->filterByDeletedDate('now'); // WHERE deleted_date = '2011-03-14'
     * $query->filterByDeletedDate(array('max' => 'yesterday')); // WHERE deleted_date > '2011-03-13'
     * </code>
     *
     * @param     mixed $deletedDate The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByDeletedDate($deletedDate = null, $comparison = null)
    {
        if (is_array($deletedDate)) {
            $useMinMax = false;
            if (isset($deletedDate['min'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::DELETED_DATE, $deletedDate['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($deletedDate['max'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::DELETED_DATE, $deletedDate['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::DELETED_DATE, $deletedDate, $comparison);
    }

    /**
     * Filter the query on the last_modified column
     *
     * Example usage:
     * <code>
     * $query->filterByLastModified('2011-03-14'); // WHERE last_modified = '2011-03-14'
     * $query->filterByLastModified('now'); // WHERE last_modified = '2011-03-14'
     * $query->filterByLastModified(array('max' => 'yesterday')); // WHERE last_modified > '2011-03-13'
     * </code>
     *
     * @param     mixed $lastModified The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByLastModified($lastModified = null, $comparison = null)
    {
        if (is_array($lastModified)) {
            $useMinMax = false;
            if (isset($lastModified['min'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::LAST_MODIFIED, $lastModified['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($lastModified['max'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::LAST_MODIFIED, $lastModified['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::LAST_MODIFIED, $lastModified, $comparison);
    }

    /**
     * Filter the query on the created column
     *
     * Example usage:
     * <code>
     * $query->filterByCreated('2011-03-14'); // WHERE created = '2011-03-14'
     * $query->filterByCreated('now'); // WHERE created = '2011-03-14'
     * $query->filterByCreated(array('max' => 'yesterday')); // WHERE created > '2011-03-13'
     * </code>
     *
     * @param     mixed $created The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function filterByCreated($created = null, $comparison = null)
    {
        if (is_array($created)) {
            $useMinMax = false;
            if (isset($created['min'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::CREATED, $created['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($created['max'])) {
                $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::CREATED, $created['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::CREATED, $created, $comparison);
    }

    /**
     * Filter the query by a related EmpevalBonusPeriods object
     *
     * @param   EmpevalBonusPeriods|PropelObjectCollection $bonusPeriods The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByBonusPeriods($bonusPeriods, $comparison = null)
    {
        if ($bonusPeriods instanceof EmpevalBonusPeriods) {
            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::BONUS_PERIOD_ID, $bonusPeriods->getId(), $comparison);
        } elseif ($bonusPeriods instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::BONUS_PERIOD_ID, $bonusPeriods->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByBonusPeriods() only accepts arguments of type EmpevalBonusPeriods or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the BonusPeriods relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function joinBonusPeriods($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('BonusPeriods');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'BonusPeriods');
        }

        return $this;
    }

    /**
     * Use the BonusPeriods relation BonusPeriods object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalBonusPeriodsQuery A secondary query class using the current class as primary query
     */
    public function useBonusPeriodsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinBonusPeriods($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'BonusPeriods', 'EmpevalBonusPeriodsQuery');
    }

    /**
     * Filter the query by a related EmpevalUsers object
     *
     * @param   EmpevalUsers|PropelObjectCollection $users The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByUsers($users, $comparison = null)
    {
        if ($users instanceof EmpevalUsers) {
            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::EDITOR_ID, $users->getId(), $comparison);
        } elseif ($users instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::EDITOR_ID, $users->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByUsers() only accepts arguments of type EmpevalUsers or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Users relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function joinUsers($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Users');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Users');
        }

        return $this;
    }

    /**
     * Use the Users relation Users object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalUsersQuery A secondary query class using the current class as primary query
     */
    public function useUsersQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinUsers($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Users', 'EmpevalUsersQuery');
    }

    /**
     * Filter the query by a related EmpevalUserPositions object
     *
     * @param   EmpevalUserPositions|PropelObjectCollection $userPositions The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByUserPositions($userPositions, $comparison = null)
    {
        if ($userPositions instanceof EmpevalUserPositions) {
            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::USER_POSITION_ID, $userPositions->getId(), $comparison);
        } elseif ($userPositions instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::USER_POSITION_ID, $userPositions->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByUserPositions() only accepts arguments of type EmpevalUserPositions or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the UserPositions relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function joinUserPositions($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('UserPositions');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'UserPositions');
        }

        return $this;
    }

    /**
     * Use the UserPositions relation UserPositions object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalUserPositionsQuery A secondary query class using the current class as primary query
     */
    public function useUserPositionsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinUserPositions($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'UserPositions', 'EmpevalUserPositionsQuery');
    }

    /**
     * Filter the query by a related EmpevalRejections object
     *
     * @param   EmpevalRejections|PropelObjectCollection $rejections  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByRejections($rejections, $comparison = null)
    {
        if ($rejections instanceof EmpevalRejections) {
            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::ID, $rejections->getBonusGoalsFormId(), $comparison);
        } elseif ($rejections instanceof PropelObjectCollection) {
            return $this
                ->useRejectionsQuery()
                ->filterByPrimaryKeys($rejections->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByRejections() only accepts arguments of type EmpevalRejections or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Rejections relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function joinRejections($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Rejections');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Rejections');
        }

        return $this;
    }

    /**
     * Use the Rejections relation Rejections object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalRejectionsQuery A secondary query class using the current class as primary query
     */
    public function useRejectionsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinRejections($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Rejections', 'EmpevalRejectionsQuery');
    }

    /**
     * Filter the query by a related EmpevalMboGoals object
     *
     * @param   EmpevalMboGoals|PropelObjectCollection $mboGoals  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByMboGoals($mboGoals, $comparison = null)
    {
        if ($mboGoals instanceof EmpevalMboGoals) {
            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::ID, $mboGoals->getBonusGoalsFormId(), $comparison);
        } elseif ($mboGoals instanceof PropelObjectCollection) {
            return $this
                ->useMboGoalsQuery()
                ->filterByPrimaryKeys($mboGoals->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByMboGoals() only accepts arguments of type EmpevalMboGoals or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the MboGoals relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function joinMboGoals($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('MboGoals');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'MboGoals');
        }

        return $this;
    }

    /**
     * Use the MboGoals relation MboGoals object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalMboGoalsQuery A secondary query class using the current class as primary query
     */
    public function useMboGoalsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinMboGoals($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'MboGoals', 'EmpevalMboGoalsQuery');
    }

    /**
     * Filter the query by a related EmpevalSummary object
     *
     * @param   EmpevalSummary|PropelObjectCollection $summary  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterBySummary($summary, $comparison = null)
    {
        if ($summary instanceof EmpevalSummary) {
            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::ID, $summary->getBonusGoalsFormId(), $comparison);
        } elseif ($summary instanceof PropelObjectCollection) {
            return $this
                ->useSummaryQuery()
                ->filterByPrimaryKeys($summary->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterBySummary() only accepts arguments of type EmpevalSummary or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Summary relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function joinSummary($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Summary');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Summary');
        }

        return $this;
    }

    /**
     * Use the Summary relation Summary object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalSummaryQuery A secondary query class using the current class as primary query
     */
    public function useSummaryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinSummary($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Summary', 'EmpevalSummaryQuery');
    }

    /**
     * Filter the query by a related EmpevalEmployeeEvaluations object
     *
     * @param   EmpevalEmployeeEvaluations|PropelObjectCollection $employeeEvaluations  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByEmployeeEvaluations($employeeEvaluations, $comparison = null)
    {
        if ($employeeEvaluations instanceof EmpevalEmployeeEvaluations) {
            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::ID, $employeeEvaluations->getBonusGoalsFormId(), $comparison);
        } elseif ($employeeEvaluations instanceof PropelObjectCollection) {
            return $this
                ->useEmployeeEvaluationsQuery()
                ->filterByPrimaryKeys($employeeEvaluations->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByEmployeeEvaluations() only accepts arguments of type EmpevalEmployeeEvaluations or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the EmployeeEvaluations relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function joinEmployeeEvaluations($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('EmployeeEvaluations');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'EmployeeEvaluations');
        }

        return $this;
    }

    /**
     * Use the EmployeeEvaluations relation EmployeeEvaluations object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalEmployeeEvaluationsQuery A secondary query class using the current class as primary query
     */
    public function useEmployeeEvaluationsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinEmployeeEvaluations($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'EmployeeEvaluations', 'EmpevalEmployeeEvaluationsQuery');
    }

    /**
     * Filter the query by a related EmpevalTaskGoals object
     *
     * @param   EmpevalTaskGoals|PropelObjectCollection $taskGoals  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByTaskGoals($taskGoals, $comparison = null)
    {
        if ($taskGoals instanceof EmpevalTaskGoals) {
            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::ID, $taskGoals->getBonusGoalsFormId(), $comparison);
        } elseif ($taskGoals instanceof PropelObjectCollection) {
            return $this
                ->useTaskGoalsQuery()
                ->filterByPrimaryKeys($taskGoals->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByTaskGoals() only accepts arguments of type EmpevalTaskGoals or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the TaskGoals relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function joinTaskGoals($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('TaskGoals');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'TaskGoals');
        }

        return $this;
    }

    /**
     * Use the TaskGoals relation TaskGoals object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalTaskGoalsQuery A secondary query class using the current class as primary query
     */
    public function useTaskGoalsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinTaskGoals($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'TaskGoals', 'EmpevalTaskGoalsQuery');
    }

    /**
     * Filter the query by a related EmpevalKpi object
     *
     * @param   EmpevalKpi|PropelObjectCollection $kpi  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByKpi($kpi, $comparison = null)
    {
        if ($kpi instanceof EmpevalKpi) {
            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::ID, $kpi->getBonusGoalsFormId(), $comparison);
        } elseif ($kpi instanceof PropelObjectCollection) {
            return $this
                ->useKpiQuery()
                ->filterByPrimaryKeys($kpi->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByKpi() only accepts arguments of type EmpevalKpi or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Kpi relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function joinKpi($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Kpi');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Kpi');
        }

        return $this;
    }

    /**
     * Use the Kpi relation Kpi object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalKpiQuery A secondary query class using the current class as primary query
     */
    public function useKpiQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinKpi($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Kpi', 'EmpevalKpiQuery');
    }

    /**
     * Filter the query by a related EmpevalAcceptance object
     *
     * @param   EmpevalAcceptance|PropelObjectCollection $acceptance  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByAcceptance($acceptance, $comparison = null)
    {
        if ($acceptance instanceof EmpevalAcceptance) {
            return $this
                ->addUsingAlias(EmpevalBonusGoalsFormsPeer::ID, $acceptance->getBonusGoalsFormId(), $comparison);
        } elseif ($acceptance instanceof PropelObjectCollection) {
            return $this
                ->useAcceptanceQuery()
                ->filterByPrimaryKeys($acceptance->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByAcceptance() only accepts arguments of type EmpevalAcceptance or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Acceptance relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function joinAcceptance($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Acceptance');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Acceptance');
        }

        return $this;
    }

    /**
     * Use the Acceptance relation Acceptance object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalAcceptanceQuery A secondary query class using the current class as primary query
     */
    public function useAcceptanceQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinAcceptance($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Acceptance', 'EmpevalAcceptanceQuery');
    }

    /**
     * Exclude object from result
     *
     * @param   EmpevalBonusGoalsForms $bonusGoalsForms Object to remove from the list of results
     *
     * @return EmpevalBonusGoalsFormsQuery The current query, for fluid interface
     */
    public function prune($bonusGoalsForms = null)
    {
        if ($bonusGoalsForms) {
            $this->addUsingAlias(EmpevalBonusGoalsFormsPeer::ID, $bonusGoalsForms->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }

}
